<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateDailyReportStatisticsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('daily_report_statistics', function (Blueprint $table) {
            $table->id();

            $table->date('date')->unique()->comment('日期');

            $table->unsignedInteger('number_of_order')->default(0)->comment('订单数');
            $table->unsignedBigInteger('total_amount_of_orders')->default(0)->comment('订单总金额');
            $table->unsignedBigInteger('total_recharge_amount')->default(0)->comment('充值总金额');
            $table->unsignedInteger('total_number_of_new_agents')->default(0)->comment('新增代理总数');

            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('daily_report_statistics');
    }
}
